package demo.day11;

import java.util.Comparator;
import java.util.Set;
import java.util.TreeSet;

/**
 * @Auther: hjy(lc))
 * @Date: 2022/8/3-08-03-15:56
 * @Description：demo.day11
 */
public class testt {
    public static void main(String[] args) {
        Set set = new TreeSet(new Comparator() {
            @Override
            public int compare(Object o1, Object o2) {
                Integer o11 = (Integer) o1;
                Integer o22 = (Integer) o2;
                if(o22%2!=0){
                    return 1;
                }else{
                    return -1;
                }
            }
        });

        for(int i=1;i<11;i++){
            set.add(i);
        }
        System.out.println(set);
    }
}
